import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  MyApp();

  factory MyApp.forDesignTime() {
    // TODO: add arguments
    return new MyApp();
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    var _count = GridView.count(
      crossAxisCount: 3,
      padding: EdgeInsets.all(10.0),
      mainAxisSpacing: 10.0,
      children: <Widget>[
        new Text("111"),
        new Text("111"),
        new Text("111"),
        new Text("111"),
        new Text("111"),
        new Text("111"),
      ],
    );
    return new MaterialApp(
        title: "list",
        home: Scaffold(
          body: new Container(
            child: GridView.builder(
                gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
                    crossAxisSpacing: 3,
                    crossAxisCount: 3,
                    childAspectRatio: 1,
                    mainAxisSpacing: 3),
                itemCount: 10,
                itemBuilder: (context, index) => Container(
                    alignment: AlignmentDirectional.center,
                    color: Colors.lightBlue,
                    child: Text("item $index"))),
          ),
          appBar: AppBar(
            title: Text("grid List"),
          ),
          floatingActionButton: FloatingActionButton(
            onPressed: () {
              print("11");
            },
            tooltip: "+",
            child: Icon(Icons.add),
          ),
        ));
  }
}
